package cn.neusoft.yuejian307.Fragment.ortherfragmnet;

import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import java.util.List;

import cn.neusoft.yuejian307.R;
import cn.neusoft.yuejian307.adapter.VideoAdapter;
import cn.neusoft.yuejian307.bean.Video;
import cn.neusoft.yuejian307.listener.UserListener;
import cn.neusoft.yuejian307.model.UserModel;



public class FragmentMasterCourse  extends Fragment implements UserListener<Video>{
    private View view;
    private RecyclerView recyclerView_video;
    @Override
    public View onCreateView(LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState)
    {
        view = inflater.inflate(R.layout.fragment_video, null) ;
        recyclerView_video = (RecyclerView)view.findViewById(R.id.recyclerView_video);
        recyclerView_video.setLayoutManager(new LinearLayoutManager(getActivity()));
        UserModel userModel = new UserModel();
        userModel.videoData(this,1);
        return view ;
    }

    @Override
    public void onResponse(Video video) {
        List<Video.ClubvideolistBean> clubvideolistBeen = video.getClubvideolist();
        VideoAdapter adapter = new VideoAdapter(getActivity(),clubvideolistBeen);
        recyclerView_video.setAdapter(adapter);
    }

    @Override
    public void onFail(String msg) {

    }
}
